import sevoes from "@/util/Http";
import Qs from "qs";
function roleInquire(data) {
  //查询
  return sevoes({
    method: "get",
    params: {
      _gp: "admin.role",
      _mt: "list",
      ...data,
    },
  });
}

function roleAddition(data) {
  //添加
  return sevoes({
    method: "post",
    data: Qs.stringify({
      _gp: "admin.role",
      _mt: "create",
      ...data,
    }),
  })
}

function roleCompile(data) {
  //编辑
  return sevoes({
    method: "post",
    data: Qs.stringify({
      _gp: "admin.role",
      _mt: "update",
      ...data,
    }),
  })
}

function roleDelete(data) { 
  //删除
  return sevoes({
    method: "post",
    data: Qs.stringify({
      _gp: "admin.role",
      _mt: "delete",
      ...data,
    }),
  })
}

function roleshouqvan(data) {
  //授权
  return sevoes({
    method: "get",
    params: {
      _gp: "admin.role",
      _mt: "permissionList",
      ...data,
    },
  });
}

function rolexgshouqvan(data) {
  //修改授权
  return sevoes({
    method: "post",
    data: Qs.stringify({
      _gp: "admin.role",
       _mt: "permissionSet",
      ...data
    }),
  })
}

export default {
  roleInquire,
  roleAddition,
  roleCompile,
  roleDelete,
  roleshouqvan,
  rolexgshouqvan,
}